local wupo = fk.CreateSkill {
  name = "inker_wupo",
  max_turn_use_time = 1,
}

wupo:addEffect("viewas", {
  anim_type = "offensive",
  pattern = "slash",
  prompt = "#inker_wupo",
  filter_pattern = {
    min_num = 1,
    max_num = 1,
    pattern = "."
  },
  view_as = function(self, player, cards)
    if #cards ~= 1 then return end
    local card = Fk:cloneCard("slash")
    card:addSubcards(cards)
    card.skillName = self.name
    return card
  end,
  before_use = function (self, player, use)
    local room = player.room
    room:addTableMark(player, "@inker_wupo-turn", use.card:getSuitString(true))
    for _, target in ipairs(room.alive_players) do
      room:addTableMark(target, "_inker_wupo-turn", use.card.suit)
      target:filterHandcards()
    end
  end
}, { check_skill_limit = true})
wupo:addEffect("filter", {
  mute = true,
  card_filter = function(self, to_select, player)
    return table.contains(player:getCardIds("h"), to_select.id) and
      table.contains(player:getTableMark("_inker_wupo-turn"), to_select.suit)
  end,
  view_as = function(self, player, to_select)
    return Fk:cloneCard("slash", to_select.suit, to_select.number)
  end,
})

Fk:loadTranslationTable{
  ["inker_wupo"] = "武魄",
  [":inker_wupo"] = "每回合限一次，你可将一张牌当【杀】使用或打出，且与之同花色牌本回合视为【杀】。",

  ["#inker_wupo"] = "武魄：将一张牌当【杀】使用或打出，且与之同花色牌本回合视为【杀】。",

  ["@inker_wupo-turn"] = "武魄",

  ["$inker_wupo1"] = "千军斩将而回，于某又有何难？",
  ["$inker_wupo2"] = "关某既出，敌将定皆披靡。",
}

return wupo